package com.hmall.common.utils;

/**
 * 基于ThreadLocal工具类  在同一线程间共享数据
 */
public class BaseContext {

    private static final ThreadLocal<String> THREAD_LOCAL_USERID = new ThreadLocal<>();

    public static void set(String id) {
        THREAD_LOCAL_USERID.set(id);
    }

    public static String get() {
        return THREAD_LOCAL_USERID.get();
    }

    public static void remove() {
        THREAD_LOCAL_USERID.remove();
    }
}
